import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
 
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JFrame;

public class Menu extends JPanel implements ActionListener{
 
    public static final int HEIGHT = 100;
    public static final int WIDTH = 300;
    private JButton start;
    private JButton instrukcje;

    private MyFrame frame;

    public Menu() {
        start = new JButton("START");
        instrukcje = new JButton("INSTRUKCJE");
 
        start.addActionListener(this);
        //instrukcje.addActionListener(this);
         
        setLayout(new FlowLayout());
        setPreferredSize(new Dimension(WIDTH, HEIGHT));
        add(start);
        add(instrukcje);
    }
 
    @Override
    public void actionPerformed(ActionEvent e) {
        Object source = e.getSource();
 
        if(source == start)
            frame = new MyFrame();
 
        else ;
    }

    class MyFrame extends JFrame {
        public MyFrame() {
            super("BrickBreaker");
	     setPreferredSize( new Dimension( WIDTH, HEIGHT ) );
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 	     setBackground(Color.GRAY);
            setVisible(true);
    	 }
    }

}

